docs(azuread-group): update docs and added examples#887
docs(azuread-group): update docs and added examples#887pablosanchezpaz wants to merge 13 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates documentation for the modules/azuread-group Terraform module and introduces terraform-docs configuration to generate richer README content (header/footer + generated inputs/outputs).
Changes:
- Added
docs/header.mdanddocs/footer.mdto serve as terraform-docs header/footer content. - Added
.terraform-docs.ymlto inject generated docs intoREADME.md. - Updated
README.mdwith an injected terraform-docs block containing module overview, examples, and generated tables.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| modules/azuread-group/docs/header.md | New module header documentation + minimal YAML usage + known issues. |
| modules/azuread-group/docs/footer.md | New footer with examples/resources/support links. |
| modules/azuread-group/README.md | Adds terraform-docs injected block (currently appended, duplicating existing docs). |
| modules/azuread-group/.terraform-docs.yml | Configures terraform-docs injection using the new header/footer files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Requirements | ||
| - Terraform >= 1.7.0 | ||
| - Provider azuread ~> 2.52.0 | ||
| - Provider azurerm = 4.16.0 | ||
|
|
There was a problem hiding this comment.
The header content adds a ## Requirements section (bullet list) and terraform-docs also generates a ## Requirements section (table) later in the same injected block, which results in duplicate headings and conflicting-looking requirement info. Consider removing the Requirements block from docs/header.md (or hiding the auto-generated Requirements section in .terraform-docs.yml) so requirements are documented only once.
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration. |
There was a problem hiding this comment.
The README Examples section lists a basic example but links to the _examples root and the module only contains _examples/with_yaml_file. This link should be updated (likely via docs/footer.md) so the README points to real example directories.
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration. | |
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration. |
| **values.yaml** | ||
| ```yaml | ||
| name: example-group-1 | ||
| description: Minimal test group | ||
| members: | ||
| - type: user | ||
| email: user-2@example.com | ||
| ``` | ||
|
|
||
| **main.tf** | ||
| ```hcl | ||
| locals { | ||
| values = yamldecode(file("./values.yaml")) | ||
| } | ||
|
|
||
| module "azuread-group" { | ||
| source = "../.." | ||
| name = local.values.name | ||
| description = local.values.description | ||
| members = local.values.members | ||
| } |
There was a problem hiding this comment.
The “Minimal usage example” is missing required module inputs. In variables.tf, both directory_roles and subscription_roles have no defaults, so omitting them will cause Terraform to fail. Update the YAML and module invocation to provide these (e.g., empty lists for a true minimal example, or a small realistic role sample).
| } | ||
| ``` | ||
|
|
||
| > For a complete working example, see the `_examples/with_yaml_file` folder in this repository. |
There was a problem hiding this comment.
This note says _examples/with_yaml_file is a “complete working example”, but that example currently pins azurerm to ~>3.100.0 while this module requires azurerm = 4.16.0 (provider constraint conflict). Either update the example to use a compatible provider constraint or adjust the wording so it doesn’t claim it’s working as-is.
| > For a complete working example, see the `_examples/with_yaml_file` folder in this repository. | |
| > For a more complete example configuration, see the `_examples/with_yaml_file` folder in this repository. Ensure that provider versions in the example align with the Requirements section above. |
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration. |
There was a problem hiding this comment.
The Examples section lists a basic example, but the link points to the _examples root and there is no basic example directory in this module (only _examples/with_yaml_file). Update the link text and URL to match the actual example folder(s).
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples) - Example showing group creation, members and PIM configuration. | |
| - [with_yaml_file](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration. |
|
Related to #786 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| } | ||
| ``` | ||
|
|
||
| > For a more complete example configuration, see the `_examples/with_yaml_file` folder in this repository. Ensure that provider versions in the example align with the Requirements section above. |
|
|
||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration. |
| source = "../.." | ||
| name = local.values.name | ||
| description = local.values.description | ||
| members = local.values.members | ||
| directory_roles = local.values.directory_roles |
| } | ||
| ``` | ||
|
|
||
| > For a more complete example configuration, see the `_examples/with_yaml_file` folder in this repository. Ensure that provider versions in the example align with the Requirements section above. |
| ### Known issues | ||
| For detailed examples, refer to the [module examples](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples): | ||
|
|
||
| - [basic](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with\_yaml\_file) - Example showing group creation, members and PIM configuration. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Azure AD Group Module | ||
|
|
||
| This Terraform module creates and manages Azure Active Directory (AD) groups, including role assignments, PIM (Privileged Identity Management), owners, and members. It supports configuration via YAML for easier management and reproducibility. | ||
|
|
||
|
|
||
| ### Provisioner actor and permissions | ||
|
|
There was a problem hiding this comment.
docs/header.md doesn’t follow the repository’s module documentation standard (see CONTRIBUTING.md “Header Documentation”). The header should include a bolded module title and the expected top-level sections (e.g., ## Overview, ## Key Features, ## Basic Usage) so terraform-docs generates consistent READMEs across modules.
| # Azure AD Group Module | |
| This Terraform module creates and manages Azure Active Directory (AD) groups, including role assignments, PIM (Privileged Identity Management), owners, and members. It supports configuration via YAML for easier management and reproducibility. | |
| ### Provisioner actor and permissions | |
| **Azure AD Group Module** | |
| ## Overview | |
| This Terraform module creates and manages Azure Active Directory (AD) groups, including role assignments, PIM (Privileged Identity Management), owners, and members. It supports configuration via YAML for easier management and reproducibility. | |
| ## Key Features | |
| - Creates and manages Azure AD groups. | |
| - Supports role assignments and PIM-related configuration. | |
| - Manages group owners and members. | |
| - Supports YAML-based configuration for easier management and reproducibility. | |
| ## Basic Usage | |
| Use this module to define and manage Azure AD groups and their related access configuration. Refer to the generated README sections below for module inputs, outputs, and usage details. | |
| ## Provisioner Actor and Permissions |
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_group_id"></a> [group\_id](#output\_group\_id) | group id | | ||
| | <a name="output_group_id"></a> [group\_id](#output\_group\_id) | n/a | |
There was a problem hiding this comment.
The generated Outputs table shows group_id description as n/a, which happens because the output "group_id" in outputs.tf has no description. Add a description to the output so the generated README contains meaningful output documentation.
| | <a name="output_group_id"></a> [group\_id](#output\_group\_id) | n/a | | |
| | <a name="output_group_id"></a> [group\_id](#output\_group\_id) | The ID of the Azure AD group | |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,120 @@ | |||
| **Azure AD Group Module** | |||
There was a problem hiding this comment.
The module title is formatted as bold text instead of an H1 heading. Other module docs use an H1 (e.g., modules/azure-aks/docs/header.md:1, modules/github-team/docs/header.md:1), which improves readability and consistent TOC/anchor behavior. Consider changing this first line to an H1 and regenerating the README via terraform-docs so the rendered title is consistent across modules.
| **Azure AD Group Module** | |
| # Azure AD Group Module |
| @@ -1,22 +1,31 @@ | |||
| ## Requirements | |||
| <!-- BEGIN_TF_DOCS --> | |||
| **Azure AD Group Module** | |||
There was a problem hiding this comment.
The README starts with a bolded title (**Azure AD Group Module**) instead of an H1 heading. In this repo, module READMEs generally start with an H1 (see modules/aws-amq-rabbit/README.md:2, modules/azure-aks/README.md:2). Consider switching to an H1 (and ideally sourcing it from docs/header.md via terraform-docs) to keep documentation structure consistent.
| **Azure AD Group Module** | |
| # Azure AD Group Module |
|
|
||
| - [with_yaml_file](https://github.com/prefapp/tfm/tree/main/modules/azuread-group/_examples/with_yaml_file) - Example showing group creation, members and PIM configuration. | ||
|
|
||
| ## Resources |
There was a problem hiding this comment.
This section title duplicates terraform-docs’ generated ## Resources section earlier in the README (the one listing Terraform resources/data sources). Having two ## Resources headings can be confusing and makes anchors ambiguous. Consider renaming this footer section to something like ## Remote resources (as used in other modules, e.g., modules/aws-amq-rabbit/docs/footer.md:9, modules/azure-aks/docs/footer.md:89).
| ## Resources | |
| ## Remote resources |
No description provided.